home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 11⁄10⁄89 / 0066-Re TGridView Dim Hil-Nov89 < prev    next >
Encoding:
Text File  |  1989-11-10  |  2.8 KB  |  106 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    2613646                         8-Nov-89        19:42
  4.  
  5. From:   D2086                           Efficient Field Svc, C Faith,PRT
  6.  
  7. To:     D1950                           CSG, Don Phillips,PRT
  8.  
  9. cc:     MACAPP.TECH$                    MacApp Technical
  10.  
  11. Sub:    RE: TGridView Dim Hilighting
  12.  
  13. George,
  14.  
  15. It was not real clear to me what you are trying to do.
  16.  
  17. I assume that you are talking about 2 different windows, a window with the list
  18. to be highlighted and a Find window.
  19.  
  20. In TView.Activate the hlDesired is set to hlDim when a window is deactivated.
  21.  
  22. TGridView.HighlightCells has this:
  23.  
  24.    IF fromHL = hlDim THEN  { GridViews don't support dim highlighting }
  25.    fromHL := hlOFF;
  26.    IF toHL = hlDim THEN
  27.    toHL := hlOFF;
  28.  
  29.    IF (fromHL <> toHL) & Focus THEN
  30.    BEGIN
  31.    CellsToPixels(theCells, pPixelsToHighlight);
  32.  
  33.    PenNormal;
  34.    UseSelectionColor;
  35.    InvertRgn(pPixelsToHighlight);  { highlight the cells }
  36.    END;
  37.  
  38. So the net effect is that highlights are disabled when TViews are deactivated.
  39.  
  40. There are several things that you could do:
  41.  
  42. 1) OVERRIDE TTextListView.Activate to set the hlDesired to hlOn instead of
  43. hlDim.  This is probably nonStandard interface stuff.
  44.  
  45. 2) OVERRIDE TTextListView.HighLighCells to support Dim highlighting.  This
  46. seems to work pretty well but I have not tested it very thoroughly:
  47.  
  48. PROCEDURE TMyGridView.HighlightCells(theCells: RgnHandle; fromHL, toHL:
  49. HLState); OVERRIDE;
  50.  
  51.    PROCEDURE DoDrawCell(aCell: GridCell);
  52.    VAR
  53.    aRect:  VRect;
  54.    aQDRect:Rect;
  55.  
  56.    BEGIN
  57.    CellToVRect(aCell,aRect);
  58.    ViewToQDRect(aRect,aQDRect);
  59.    InsetRect(aQDRect,fColInset,fRowInset);
  60.    DrawCell(aCell,aQDRect);
  61.    END;
  62.  
  63.    BEGIN
  64.    IF (fromHL = hlON) AND (toHL = hlDim)  & Focus THEN { GridViews don't
  65. support dim highlighting }
  66.    BEGIN
  67.    CellsToPixels(theCells, pPixelsToHighlight);
  68.  
  69.    PenPat(gray);
  70.    PenMode(patBic);
  71.    PaintRgn(pPixelsToHighlight);   { dim or re-Highlight the cells }
  72.    END
  73.    ELSE IF (fromHL = hlDim) AND (toHL = hlON)  & Focus THEN
  74.    BEGIN
  75.    CellsToPixels(theCells, pPixelsToHighlight);
  76.    PenPat(white);
  77.    PenMode(patCopy);
  78.    PaintRgn(pPixelsToHighlight);   { blank out the cells }
  79.  
  80.  
  81.    EachSelectedCellDo(DoDrawCell); { redraw the cells }
  82.  
  83.    PenNormal;
  84.    UseSelectionColor;
  85.    InvertRgn(pPixelsToHighlight);  { highlight the cells }
  86.    END
  87.    ELSE IF (fromHL <> toHL) & Focus THEN
  88.    BEGIN
  89.    CellsToPixels(theCells, pPixelsToHighlight);
  90.  
  91.    PenNormal;
  92.    UseSelectionColor;
  93.    InvertRgn(pPixelsToHighlight);  { highlight the cells }
  94.    END;
  95.    END;
  96.  
  97. This should have the correct effect, it seems to work well with both color and
  98. monochrome monitors.  Dim highlighting would only take place via activate as no
  99. other methods det the hlDesired.
  100.  
  101. I hope this helps!
  102.  
  103. - Curtis Faith
  104.  
  105.  
  106.